package org.maiyoframework.assist.webservice;

import java.util.List;

import javax.annotation.Resource;
import javax.jws.WebService;

import org.maiyoframework.assist.dao.UserDao;
import org.maiyoframework.assist.entity.User;
import org.maiyoframework.core.jpa.Condition;
import org.maiyoframework.core.jpa.Finder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
@WebService(endpointInterface = "org.maiyoframework.assist.webservice.MaiyoCoreWs")
public class MaiyoCoreWsImpl implements MaiyoCoreWs {

	public List<User> findListByEmail(String email) {
		Finder finder = new Finder();
		finder.setWhere(new Condition("email like", "%" + email + "%"));
		finder.setOrderBy("registerTime", "desc");
		return dao.findList(finder);
	}

	@Resource
	private UserDao dao;

}
